﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.RoboticOperationMerge.CCoROMRoboticOperationMergeCmd
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Resources;
using System.Windows.Forms;
using Tecnomatix.Engineering;
using Tecnomatix.Engineering.Ui;


namespace DnProcessSimulateCommands.RoboticOperationMerge;

public class CCoROMRoboticOperationMergeCmd : TxButtonCommand
{
  private CCoROMRoboticOperationMergeCmdEnabler m_enabler;
  private CUiROMMainForm m_form;

  public CCoROMRoboticOperationMergeCmd()
  {
    this.m_form = (CUiROMMainForm) null;
    this.m_enabler = new CCoROMRoboticOperationMergeCmdEnabler();
  }

  public virtual string Bitmap => "RoboticOperationMerge.Res.ROMCmdIcon.bmp";

  public virtual string LargeBitmap => "RoboticOperationMerge.Res.ROMCmdIcon_LARGE.png";

  public virtual string Category => this.GetResourceManager().GetString("RM_CMD_CATEGORY");

  public virtual ITxCommandEnabler CommandEnabler => (ITxCommandEnabler) this.m_enabler;

  public virtual string Description => this.GetResourceManager().GetString("RM_CMD_DESCRIPTION");

  public virtual string Tooltip => this.GetResourceManager().GetString("RM_CMD_TOOLTIP");

  public virtual string Name => this.GetResourceManager().GetString("RM_CMD_NAME");

  public virtual bool Licensed => TxCommandLicenser.RoboticOperationMergeLicense;

  public virtual ITxImage Image => (ITxImage) TxImageManager.GetImageByKey("RoboticOperationMerge");

  public virtual string[] AdvancedDescriptions => TxCallMessages.CollectMessages((ITxCommand) this);

  private ResourceManager GetResourceManager()
  {
    return new ResourceManager("DnProcessSimulateCommands.RoboticOperationMerge.Res.ResourceTable", ((object) this).GetType().Assembly);
  }

  public virtual void Execute(object cmdParams)
  {
    if (!this.m_enabler.Enable || this.m_form != null)
      return;
    this.m_form = new CUiROMMainForm(this);
    if (this.m_form == null)
      return;
    this.m_enabler.ManualDisable = true;
    ((Form) this.m_form).FormClosed += new FormClosedEventHandler(this.m_form_FormClosed);
  }

  private void m_form_FormClosed(object sender, FormClosedEventArgs e)
  {
    ((Form) this.m_form).FormClosed -= new FormClosedEventHandler(this.m_form_FormClosed);
    this.m_form = (CUiROMMainForm) null;
    this.m_enabler.ManualDisable = false;
  }
}
